export default {
    install: (Vue, option) => {
        Vue.prototype.uxtLoading = p => {
            let pages = getCurrentPages()

            // #ifdef H5
            let layout = pages[pages.length - 1].$children[0]
            // #endif

            // #ifndef H5
            let layout = pages[pages.length - 1].$vm.$children[0]
            // #endif

            // console.log(layout)
            p && layout.setLoading(p)
            return {
                show() {
                    layout.showLoading()
                },
                hide() {
                    layout.hideLoading()
                }
            }
        }
    }
}
